package com.tong.hao.ac.api.model.in.account;

import cn.buddha.jec.model.TongBaseRequest;
import com.tong.hao.ac.api.model.RegexpConstant;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.validation.constraints.Email;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @ClassName AC020001Req
 * @Author 友野浩二
 * @Date 2020/5/2 21:34
 * @Description 用户注册请求模型 DTO(Data Transfer Object)：数据传输对象
 * @Version 1.0
 */
@Setter
@Getter
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class AC020001Req extends TongBaseRequest {
    private static final long serialVersionUID = 9070145163559449755L;

    @ApiModelProperty(value = "用户名称", required = true)
    @NotBlank
    private String acName;

    @ApiModelProperty(value = "年龄", required = true, position = 1)
    @NotNull
    @Min(value = 1, message = "{demoReq.age}")
    private Integer age;

    @ApiModelProperty(value = "电子邮件", position = 2)
    @Email(regexp = RegexpConstant.EMAIL_ENUM, message = "电子邮箱格式错误")
    private String email;

    @ApiModelProperty(value = "手机号", position = 3)
    @Pattern(regexp = RegexpConstant.PHONE_ENUM, message = "手机号格式错误")
    private String phone;
}
